package io.renren.modules.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.dao.BsRoomProductDao;
import io.renren.modules.dto.BsRoomProductDTO;
import io.renren.modules.entity.BsRoomProductEntity;
import io.renren.modules.service.BsRoomProductService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 房间和产品关联表，用来给某些房间指定不同价格。
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2024-05-27
 */
@Service
public class BsRoomProductServiceImpl extends CrudServiceImpl<BsRoomProductDao, BsRoomProductEntity, BsRoomProductDTO> implements BsRoomProductService {

    @Override
    public QueryWrapper<BsRoomProductEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<BsRoomProductEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


}